package com.itmd.service.imp;

import com.itmd.dao.UserDao;
import com.itmd.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service("userService")  //service层的 Component ,只是便于理解 同理 还有 @Reponsitry （dao层，数据存储层） @Controller（web层，前端接口控制） 两个注解
public class UserServiceImp implements UserService {

    @Autowired
//    @Qualifier("userDao")
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void save() {
        userDao.save();
    }
}
